#ifndef M0WIG_H
#define M0WIG_H
#include "m0wig.h"
#include "ui_m0wig.h"
#include "globalval.h"
#include "mqtthandler.h"
#include <QTimer>
#include <qmqtt_client.h>
#include "mqtt/qmqtt.h"
#include <QByteArray>
#include <QWidget>
#include <QMetaType>
#include <QVariant>


namespace Ui {
class M0Wig;
}

class M0Wig : public QWidget
{
    Q_OBJECT

public:
    int key;  //唯一键值
    int type;  //数据点类型
    int result;//成功标志
    QString val;
    explicit M0Wig(QWidget *parent = 0);

    void reJSON(QByteArray payload);
    //保存到JSON文件
    bool saveJSONToFile(const QByteArray& jsonData, const QString& filePath);
    //QString M0Wig::getAppDataPath();

    ~M0Wig();
    //~val_t() = delete;

private:
    Ui::M0Wig *ui;

public slots:
   void dataUpSlot(QByteArray payload);
   void dataCtrlSlot(QByteArray payload);

private slots:
   void on_lampBtnop_clicked();
   void on_lampBtncl_clicked();
   void on_fnaBtnop_clicked();
   void on_fanBtncl_clicked();
   void on_pushButton_clicked();
   void on_pushButton_2_clicked();
   void on_pushButton_3_clicked();
   void on_pushButton_4_clicked();
   //void historyDataReceived(int key, const QList<QPair<qint64, QString>>& historyData);//历史数据槽函数
};


#endif // M0WIG_H











